package cn.njxzc.demo.bam;

public class CreditAccount extends Account {
	
	private double ceiling;
	public CreditAccount(long id,String password,String realName,
			String personId){
		super(id, password, realName, personId);
	}

	public double getCeiling() {
		return ceiling;
	}

	public void setCeiling(double ceiling) {
		this.ceiling = ceiling;
	}

	@Override
	public boolean withdraw(double money) {
		double balance = this.getBalance();
		if ( money > (ceiling+balance) ) {
			return false;
		}else {
			balance -= money;
			this.setBalance(balance);
			return true;
		}
	}


}
